﻿<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="Keywords" content="{$keywords}" />
    <meta name="Description" content="{$description}" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>{$page_title}</title>
    <!-- TemplateEndEditable --><!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
    <link rel="shortcut icon" href="favicon.ico" />
    <link rel="icon" href="animated_favicon.gif" type="image/gif" />
    <link rel="stylesheet" href="themes/fulite/css/mll_common.min.css" />
    <link href="{$ecs_css_path}" rel="stylesheet" type="text/css" />
    <link href="themes/fulite/css/flow.min.css" rel="stylesheet" type="text/css" />
    {insert_scripts files='transport.js,common.js,user.js,utils.js,jquery.min.js'}
    {* 包含脚本文件 *}
    {insert_scripts files='shopping_flow.js'}
    <script src="themes/fulite/js/jquery.json.min.js"></script>
    <script src="themes/fulite/js/layer.js"></script>
    <style type="text/css">
        /*输入密码弹窗*/
        .inpt_pasword {
            font-size: 1vw;
            line-height: 1.3vw;
            display: none;
        }

        .bottom000 {
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.2);
            position: fixed;
            z-index: 1;
            left: 0;
            top: 0;
        }

        .pasword {
            position: fixed;
            background: #FFF;
            border-radius: 5px;
            width: 20%;
            left: 40%;
            top: 30%;
            z-index: 2;
            float: left;
        }

            .pasword input {
                width: 80%;
                height: 1.2vw;
                margin: 1.2vw 0 1.2vw 9%;
                border: 1px solid #CCCBD9;
                float: left;
            }

            .pasword p:first-of-type {
                text-align: center;
                background: #ffb346;
                color: #FFF;
                line-height: 2vw;
                float: left;
                width: 100%;
            }

            .pasword p:last-of-type {
                text-align: center;
                float: left;
                width: 100%;
                background: #F1F1F1;
                border-top: 1px solid #CCCBD9;
            }

            .pasword p span {
                float: left;
                width: 49%;
                color: #000;
                line-height: 2vw;
                cursor: pointer;
            }

                .pasword p span:first-of-type {
                    color: #fb861f;
                    border-right: 1px solid #CCCBD9;
                    width: 50%;
                }
    </style>
</head>
<body>
    <div class="page-header fl_page-header">
        <div class="w clearfix">
            <div class="Right">
                <table class="topMenu">
                    <tr>
                        {if $smarty.session.user_id > 0}
                        <td id="JS_head_login" class="login"><a href="user.php" target="_blank" class="red" style="display:inline-block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:40px;">{$smarty.session.user_name}</a> <span id="JS_head_sita_name_haier">欢迎光临！</span> <a href="user.php?act=logout" class="red" id="JS_login_out">[退出]</a></td>
                        <td><em class="line"></em></td>

                        {else}
                        <td id="JS_head_login" class="login"><span>您好，欢迎光临！</span><em class="line"></em><a href="user.php" title="登录">登录</a><em class="line"></em><a href="user.php?act=register" title="免费注册帐号">注册</a></td>
                        <td><em class="line"></em></td>
                        {/if}
                        <td><a href="user.php?act=order_list" target="_blank" title="我的订单">我的订单</a></td>
                        <td><em class="line"></em></td>
                        <td><a href="#" target="_blank" title="帮助">帮助中心</a></td>
                        <td><em class="line"></em></td>
                        <td style="width:150px;"><div id="JS_head_scoll_phone_527" style="width:150px;height:24px;overflow:hidden;position:relative"><span>服务热线：</span><span class="hotLine">0519-83811258</span></div></td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div class="block">
        <!-- {if $step eq "cart"} -->
        <!-- 购物车内容 -->
        {* 包含脚本文件 *}
        {insert_scripts files='showdiv.js'}
        <script type="text/javascript">
  {foreach from=$lang.password_js item=item key=key}
    var {$key} = "{$item}";
  {/foreach}
        </script>
        <div class="w fl_header clearfix">
            <a class="Left" href="/"><img src="images/blank.jpg" width="146" height="53" /></a>
            <div class="Right fl_step fl_step_cart"></div>
        </div>
        <div class="flow_h2 w mt20 clearfix">
            <div class="Left text">我的购物车</div>
        </div>
        <table class="w mt20 cart_table" id="JS_list_table_cb">
            <tr>
                <th class="first" style="" colspan="2">商品</th>
                <th style="width:16%">{$lang.goods_attr}</th>
                <th style="width:8%">单价</th>
                <th style="width:15%">数量</th>
                <th style="width:8%">金额</th>
                <th style="width:10%">操作</th>
            </tr>
            <form id="formCart" name="formCart" method="post" action="flow.php">
                <!-- {if $goods_list} -->
                <!-- {foreach from=$goods_list item=goods} -->
                <tr  id="tr_goods_{$goods.rec_id}">
                    <!-- {if $goods.goods_id gt 0 && $goods.extension_code neq 'package_buy'} 商品 -->
                    <td style="width:110px;"><a href="goods.php?id={$goods.goods_id}" target="_blank"><img class="img" src="{$goods.goods_thumb}" width="90" height="58" title="查看商品" /></a> </td>
                    <td class="l" style="line-height:1.5"><a href="goods.php?id={$goods.goods_id}" target="_blank">{$goods.goods_name}</a> </td>
                    <!-- {elseif $goods.goods_id gt 0 && $goods.extension_code eq 'package_buy'} -->
                    <td style="width:110px;">
                        <!-- {foreach from=$goods.package_goods_list item=package_goods_list name=package_goods_list} -->
                        {if $smarty.foreach.package_goods_list.iteration eq 1}
                        <a href="goods.php?id={$package_goods_list.goods_id}" target="_blank"><img class="img" src="<!--{foreach from=get_goods_ex($GLOBALS['smarty']->_var['goods']['goods_id']) item=goods_data name=get_goods_ex}--><!-- {if $smarty.foreach.get_goods_ex.iteration eq 1}-->{$goods_data.goods_thumb}<!-- {/if} --><!--{/foreach}-->" width="90" height="58" title="查看商品" /></a>
                        {/if}
                        <!-- {/foreach} -->
                    </td>
                    <td class="l" style="line-height:1.5">
                        <a href="javascript:void(0)" onclick="setSuitShow({$goods.goods_id})" class="f6">{$goods.goods_name}<span style="color:#FF0000;">（{$lang.remark_package}）</span></a>
                        <div id="suit_{$goods.goods_id}" style="display:none">
                            <!-- {foreach from=$goods.package_goods_list item=package_goods_list} -->
                            <a href="goods.php?id={$package_goods_list.goods_id}" target="_blank" class="f6">{$package_goods_list.goods_name}</a><br />
                            <!-- {/foreach} -->
                        </div>
                    </td>
                    <!-- {/if} -->
                    <td class="yen">{$goods.goods_attr|nl2br}</td>
                    <td class="yen">{$goods.goods_price}</td>
                    <td>
                        <div class="clearfix number">
                            <a href="javascript:;" onclick="changenum({$goods.rec_id},-1);return false;" class="Left sub" title="减少数量"></a>
                            <input type="text" name="goods_number[{$goods.rec_id}]" id="goods_number_{$goods.rec_id}" value="{$goods.goods_number}" size="4" class="Left num" style="text-align:center " onBlur="change_goods_number({$goods.rec_id},this.value)" />
                            <a class="Left add" href="javascript:;" onclick="changenum({$goods.rec_id},1);return false;" title="增加数量"></a><span class="Left unit"></span>
                        </div>
                    </td>
                    <td class="yen"><div class="goods_subtotal yen" id="goods_subtotal_{$goods.rec_id}">{$goods.subtotal}</div></td>
                    <td>
                        <a class="orange" href="javascript:if (confirm('{$lang.drop_goods_confirm}')) location.href='flow.php?step=drop_goods&amp;id={$goods.rec_id}'; ">{$lang.drop}</a>
                        <!-- {if $smarty.session.user_id gt 0 && $goods.extension_code neq 'package_buy'} 如果登录了，可以加入收藏 -->
                        <a class="orange" href="javascript:if (confirm('{$lang.drop_goods_confirm}')) location.href='flow.php?step=drop_to_collect&amp;id={$goods.rec_id}'; ">{$lang.drop_to_collect}</a>
                        <!-- {/if} -->
                    </td>
                </tr>
                <!-- {/foreach} -->
                <!-- {else} -->
                <tr>
                    <td colspan="7" bgcolor="#ffffff" height="50px" align="center" style=" font-weight:bold">您的购物车中没有任何商品!</td>
                </tr>
                <!-- {/if} -->
                <input type="hidden" name="step" value="update_cart" />
            </form>
        </table>
        <div class="w cart_extra clearfix">
            <div class="Left"> <a href="javascript:;" onClick="javascript:if (confirm('确定{$lang.clear_cart}?')) location.href='flow.php?step=clear'; " class="delete_cart_goods" title="{$lang.clear_cart}">{$lang.clear_cart}</a> </div>
            <div class="Right r"> <span class="f14 bt"><b>商品总价</b>(不含运费)：<span class="red yen total_price"><span id="total_desc">{$total.goods_price}</span></span></span> </div>
        </div>
        <div class="cart_button w r mt20"> <a href="/" class="back" title="继续购物"></a>&ensp;<a title="去结算" href="flow.php?step=checkout" class="check"></a> </div>
        <script language="javascript">


function changenum(rec_id, diff)
            {
                var goods_number =Number(document.getElementById('goods_number_' + rec_id).value) + Number(diff);             
                change_goods_number(rec_id,goods_number);
            }
            function change_goods_number(rec_id, goods_number)
            {     
               Ajax.call('flow.php?step=ajax_update_cart', 'rec_id=' + rec_id +'&goods_number=' + goods_number, change_goods_number_response, 'POST','JSON');                
            }
            function change_goods_number_response(result)
            {               
                if (result.error == 0)
                {
                    var rec_id = result.rec_id;
                    document.getElementById('goods_number_' +rec_id).value = result.goods_number;//更新数量
                    document.getElementById('goods_subtotal_' +rec_id).innerHTML = result.goods_subtotal;//更新小计
                    if (result.goods_number <= 0)
                    {// 数量为零则隐藏所在行
                        document.getElementById('tr_goods_' +rec_id).style.display = 'none';
                        document.getElementById('tr_goods_' +rec_id).innerHTML = '';
                    }
                    document.getElementById('total_desc').innerHTML =result.total_price;//更新合计
                    if (document.getElementById('ECS_CARTINFO'))
                    {//更新购物车数量
                       document.getElementById('ECS_CARTINFO').innerHTML = result.cart_info;
                    }
                }
                else if (result.message != '')
                {
                    alert(result.message);
                }                
            }



        </script>
        <!-- {/if} -->
        <!-- {if $step eq "consignee"} -->
        <!-- 开始收货人信息填写界面 -->
        {insert_scripts files='region.js,utils.js'}
        <script type="text/javascript">
          region.isAdmin = false;
          {foreach from=$lang.flow_js item=item key=key}
          var {$key} = "{$item}";
          {/foreach}

          {literal}
          onload = function() {
            if (!document.all)
            {
              document.forms['theForm'].reset();
            }
          }
          {/literal}
        </script>
        <div class="w fl_header clearfix">
            <a class="Left" href="/"><img class="fl_logo" src="images/blank.jpg"></a>
            <div class="Right fl_step fl_step_pre_checkout"></div>
        </div>
        <!-- 如果有收货地址，循环显示用户的收获地址 -->
        <!-- {foreach from=$consignee_list item=consignee key=sn} -->
        <form action="flow.php" method="post" name="theForm" id="theForm" onSubmit="return checkConsignee(this)">
            <div class="flowBox">
                <h6><span>{$lang.consignee_info}</span></h6>
                {insert_scripts files='utils.js,transport.js'}
                <table width="100%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
                    <!-- {if $real_goods_count gt 0} -->
                    <!-- 购物车中存在实体商品显示国家和地区 -->
                    <tr>
                        <td bgcolor="#ffffff">{$lang.country_province}:</td>
                        <td colspan="3" bgcolor="#ffffff">
                            <select name="country" id="selCountries_{$sn}" onchange="region.changed(this, 1, 'selProvinces_{$sn}')" style="border:1px solid #ccc; height:22px">
                                <option value="0">{$lang.please_select}{$name_of_region[0]}</option>
                                <!-- {foreach from=$country_list item=country} -->
                                <option value="{$country.region_id}" {if $consignee.country eq $country.region_id}selected{/if}>{$country.region_name}</option>
                                <!-- {/foreach} -->
                            </select>
                            <select name="province" id="selProvinces_{$sn}" onchange="region.changed(this, 2, 'selCities_{$sn}')" style="border:1px solid #ccc;height:22px">
                                <option value="0">{$lang.please_select}{$name_of_region[1]}</option>
                                <!-- {foreach from=$province_list.$sn item=province} -->
                                <option value="{$province.region_id}" {if $consignee.province eq $province.region_id}selected{/if}>{$province.region_name}</option>
                                <!-- {/foreach} -->
                            </select>
                            <select name="city" id="selCities_{$sn}" onchange="region.changed(this, 3, 'selDistricts_{$sn}')" style="border:1px solid #ccc;height:22px">
                                <option value="0">{$lang.please_select}{$name_of_region[2]}</option>
                                <!-- {foreach from=$city_list.$sn item=city} -->
                                <option value="{$city.region_id}" {if $consignee.city eq $city.region_id}selected{/if}>{$city.region_name}</option>
                                <!-- {/foreach} -->
                            </select>
                            <select name="district" id="selDistricts_{$sn}" {if !$district_list.$sn}{/if} style="border:1px solid #ccc;height:22px">
                            <option value="0">{$lang.please_select}{$name_of_region[3]}</option>
                            <!-- {foreach from=$district_list.$sn item=district} -->
                            <option value="{$district.region_id}" {if $consignee.district eq $district.region_id}selected{/if}>{$district.region_name}</option>
                            <!-- {/foreach} -->
                            </select>
                            {$lang.require_field}
                        </td>
                    </tr>
                    <!-- {/if} -->
                    <tr>
                        <td bgcolor="#ffffff">{$lang.consignee_name}:</td>
                        <td bgcolor="#ffffff">
                            <input name="consignee" type="text" class="inputBg" id="consignee_{$sn}" value="{$consignee.consignee|escape}" />
                            {$lang.require_field}
                        </td>
                        <td bgcolor="#ffffff">{$lang.email_address}:</td>
                        <td bgcolor="#ffffff">
                            <input name="email" type="text" class="inputBg" id="email_{$sn}" value="{$consignee.email|escape}" />
                            {$lang.require_field}
                        </td>
                    </tr>
                    <!-- {if $real_goods_count gt 0} -->
                    <!-- 购物车中存在实体商品显示详细地址以及邮政编码 -->
                    <tr>
                        <td bgcolor="#ffffff">{$lang.detailed_address}:</td>
                        <td bgcolor="#ffffff">
                            <input name="address" type="text" class="inputBg" id="address_{$sn}" value="{$consignee.address|escape}" />
                            {$lang.require_field}
                        </td>
                        <td bgcolor="#ffffff">{$lang.postalcode}:</td>
                        <td bgcolor="#ffffff"><input name="zipcode" type="text" class="inputBg" id="zipcode_{$sn}" value="{$consignee.zipcode|escape}" /></td>
                    </tr>
                    <!-- {/if} -->
                    <tr>
                        <td bgcolor="#ffffff">{$lang.phone}:</td>
                        <td bgcolor="#ffffff">
                            <input name="tel" type="text" class="inputBg" id="tel_{$sn}" value="{$consignee.tel|escape}" />
                            {$lang.require_field}
                        </td>
                        <td bgcolor="#ffffff">{$lang.backup_phone}:</td>
                        <td bgcolor="#ffffff"><input name="mobile" type="text" class="inputBg" id="mobile_{$sn}" value="{$consignee.mobile|escape}" /></td>
                    </tr>
                    <!-- {if $real_goods_count gt 0} -->
                    <!-- 购物车中存在实体商品显示最佳送货时间及标志行建筑 -->
                    <tr>
                        <td bgcolor="#ffffff">{$lang.sign_building}:</td>
                        <td bgcolor="#ffffff"><input name="sign_building" type="text" class="inputBg" id="sign_building_{$sn}" value="{$consignee.sign_building|escape}" /></td>
                        <td bgcolor="#ffffff">{$lang.deliver_goods_time}:</td>
                        <td bgcolor="#ffffff"><input name="best_time" type="text" class="inputBg" id="best_time_{$sn}" value="{$consignee.best_time|escape}" /></td>
                    </tr>
                    <!-- {/if} -->
                    <tr>
                        <td colspan="4" align="center" bgcolor="#ffffff">
                            <input type="submit" name="Submit" class="bnt_blue_2" value="{$lang.shipping_address}" />
                            <!-- {if $smarty.session.user_id gt 0 and $consignee.address_id gt 0} -->
                            <!-- 如果登录了，显示删除按钮 -->
                            <input name="button" type="button" onclick="if (confirm('{$lang.drop_consignee_confirm}')) location.href='flow.php?step=drop_consignee&amp;id={$consignee.address_id}'" class="bnt_blue" value="{$lang.drop}" />
                            <!-- {/if} -->
                            <input type="hidden" name="step" value="consignee" />
                            <input type="hidden" name="act" value="checkout" />
                            <input name="address_id" type="hidden" value="{$consignee.address_id}" />
                        </td>
                    </tr>
                </table>
            </div>
        </form>
        <!-- {/foreach} -->
        <!-- {/if} -->
        <!-- {if $step eq "checkout"} 开始订单确认界面 -->
        {insert_scripts files='region.js,utils.js'}
        <script type="text/javascript">
region.isAdmin = false;
{foreach from=$lang.flow_js item=item key=key}
var {$key} = "{$item}";
{/foreach}

function shippingBox_change(frm)
{
	var con_country = frm.elements['country'].value;
	var con_province = frm.elements['province'].value;
	var con_city = frm.elements['city'].value;
	var con_district = frm.elements['district'].value;
	document.getElementById("shippingBox").innerHTML='<font color="#ff3300">&nbsp;&nbsp;&nbsp;正在重新导入配送区域，请稍候...</font>';
	Ajax.call('flow.php?step=shipping_change', 'country=' +con_country+'&province='+con_province+'&city='+con_city+'&district='+con_district , shippingBoxchangeResponse , 'GET', 'JSON');
}

function shippingBoxchangeResponse(result)
{
	document.getElementById("shippingBox_msg").innerHTML= '配送区域已经变化，请重新选择物流';
	document.getElementById("shippingBox").innerHTML= result.content;
}
/* *
 * 改变配送方式
 */
function selectShipping(obj)
{

	/* start by jianhualiucheng */
  var theForm = obj.form;
  var con_country = theForm.elements['country'].value;
  var con_province = theForm.elements['province'].value;
  var con_city = theForm.elements['city'].value;
  var con_district = theForm.elements['district'].value;
  if ( con_country=='0' || con_province == '0' || con_city == '0' || con_district == '0')
  {
	  alert('请选择完整的配送区域（省市县）！');
	  obj.checked= false;
	  return ;
  }
  else
	{
	document.getElementById('shippingBox_msg').innerHTML='';
  }
  /* end by jianhualiucheng */

  if (selectedShipping == obj)
  {
    return;
  }
  else
  {
    selectedShipping = obj;
  }

  var supportCod = obj.attributes['supportCod'].value + 0;
  var theForm = obj.form;

  for (i = 0; i < theForm.elements.length; i ++ )
  {
    if (theForm.elements[i].name == 'payment' && theForm.elements[i].attributes['isCod'].value == '1')
    {
      if (supportCod == 0)
      {
        theForm.elements[i].checked = false;
        theForm.elements[i].disabled = true;
      }
      else
      {
        theForm.elements[i].disabled = false;
      }
    }
  }




  if (obj.attributes['insure'].value + 0 == 0)
  {
    document.getElementById('ECS_NEEDINSURE').checked = false;
    document.getElementById('ECS_NEEDINSURE').disabled = true;
  }
  else
  {
    document.getElementById('ECS_NEEDINSURE').checked = false;
    document.getElementById('ECS_NEEDINSURE').disabled = false;
  }

  var now = new Date();
  Ajax.call('flow.php?step=select_shipping', 'shipping=' + obj.value+'&country='+con_country+'&province='+con_province+'&city='+con_city+'&district='+con_district, orderShippingSelectedResponse, 'GET', 'JSON'); //修改 by jianhualiucheng
}


/* *
 * 改变支付方式
 */
function selectPayment(obj)
{

 /* start by jianhualiucheng */
	var theForm = obj.form;
	var con_country = theForm.elements['country'].value;
	var con_province = theForm.elements['province'].value;
	var con_city = theForm.elements['city'].value;
	var con_district = theForm.elements['district'].value;
	 if ( con_country=='0' || con_province == '0' || con_city == '0' || con_district == '0')
  {
	  alert('请选择完整的配送区域（省市县）！');
	  obj.checked= false;
	  return ;
  }
  /* end by jianhualiucheng */

  if (selectedPayment == obj)
  {
    return;
  }
  else
  {
    selectedPayment = obj;
  }
  Ajax.call('flow.php?step=select_payment', 'payment=' + obj.value+'&country='+con_country+'&province='+con_province+'&city='+con_city+'&district='+con_district, orderSelectedResponse, 'GET', 'JSON'); //修改 by jianhualiucheng
}
/* *
 * 改变商品包装
 */
function selectPack(obj)
{

/* start by jianhualiucheng */
  var theForm = obj.form;
  var con_country = theForm.elements['country'].value;
  var con_province = theForm.elements['province'].value;
  var con_city = theForm.elements['city'].value;
  var con_district = theForm.elements['district'].value;
  if ( con_country=='0' || con_province == '0' || con_city == '0' || con_district == '0')
  {
	  alert('请选择完整的配送区域（省市县）！');
	  obj.checked= false;
	  return ;
  }
  /* end by jianhualiucheng */

  if (selectedPack == obj)
  {
    return;
  }
  else
  {
    selectedPack = obj;
  }

  Ajax.call('flow.php?step=select_pack', 'pack=' + obj.value+'&country='+con_country+'&province='+con_province+'&city='+con_city+'&district='+con_district, orderSelectedResponse, 'GET', 'JSON'); //修改 by jianhualiucheng
}
/* *
 * 改变祝福贺卡
 */
function selectCard(obj)
{
  if (selectedCard == obj)
  {
    return;
  }
  else
  {
    selectedCard = obj;
  }

  Ajax.call('flow.php?step=select_card', 'card=' + obj.value, orderSelectedResponse, 'GET', 'JSON'); //修改 by jianhualiucheng
}

/* *
 * 选定了配送保价
 */
function selectInsure(needInsure)
{
  needInsure = needInsure ? 1 : 0;

  Ajax.call('flow.php?step=select_insure', 'insure=' + needInsure, orderSelectedResponse, 'GET', 'JSON'); //修改 by jianhualiucheng
}

/**
 * 验证红包序列号
 * @param string bonusSn 红包序列号
 */
function validateBonus(bonusSn)
{
/* start by jianhualiucheng */
  var theForm = document.getElementById("theForm");
  var con_country = theForm.elements['country'].value;
  var con_province = theForm.elements['province'].value;
  var con_city = theForm.elements['city'].value;
  var con_district = theForm.elements['district'].value;
  if ( con_country=='0' || con_province == '0' || con_city == '0' || con_district == '0')
  {
	  alert('请选择完整的配送区域（省市县）！');

	  return ;
  }
  /* end by jianhualiucheng */
  Ajax.call('flow.php?step=validate_bonus', 'bonus_sn=' + bonusSn+'&country='+con_country+'&province='+con_province+'&city='+con_city+'&district='+con_district, validateBonusResponse, 'GET', 'JSON'); //修改 by jianhualiucheng
}


/* *
 * 检查提交的订单表单
 */
var is_checked = false;
function checkOrderForm(frm)
{
  var paymentSelected = false;
  var shippingSelected = false;

//增加_start By jianhualiucheng
  var telinput=false;
  var consigneeSelected1=false;
  var consigneeSelected2=false;
  var consigneeSelected3=false;
  var addressinput=false;
  //增加_end By jianhualiucheng

  // 检查是否选择了支付配送方式
  for (i = 0; i < frm.elements.length; i ++ )
  {
    if (frm.elements[i].name == 'shipping' && frm.elements[i].checked)
    {
      shippingSelected = true;
    }

	//增加_start By jianhualiucheng
	if (frm.elements[i].name == 'tel' && frm.elements[i].value)
    {
      telinput = true;
    }
	 if (frm.elements[i].name == 'address' && frm.elements[i].value)
    {
      addressinput = true;
    }
	 if (frm.elements[i].name == 'province' && frm.elements[i].value!='0')
    {
		consigneeSelected1 = true;
    }
	 if (frm.elements[i].name == 'city' && frm.elements[i].value!='0')
    {
		consigneeSelected2 = true;
    }
	 if (frm.elements[i].name == 'district' && frm.elements[i].value!='0')
    {
		consigneeSelected3 = true;
    }
	//增加_end By jianhualiucheng


    if (frm.elements[i].name == 'payment' && frm.elements[i].checked)
    {
      paymentSelected = true;
    }
  }


//增加_start By jianhualiucheng
  if ( ! telinput)
  {
    alert("收货人电话没有填写！！");
    return false;
  }
  if ( ! addressinput)
  {
    alert("收货地址没有填写！！");
    return false;
  }
  if ( ! consigneeSelected1 || ! consigneeSelected2 || ! consigneeSelected3)
  {
    alert("配送区域没有选择！！");
    return false;
  }
  //增加_end By jianhualiucheng

  if ( ! shippingSelected)
  {
    alert(flow_no_shipping);
    return false;
  }

  if ( ! paymentSelected)
  {
    alert(flow_no_payment);
    return false;
  }

  // 检查用户输入的余额
  if (document.getElementById("ECS_SURPLUS"))
  {
    var surplus = document.getElementById("ECS_SURPLUS").value;
    var error   = Utils.trim(Ajax.call('flow.php?step=check_surplus', 'surplus=' + surplus, null, 'GET', 'TEXT', false));

    if (error)
    {
      try
      {
        document.getElementById("ECS_SURPLUS_NOTICE").innerHTML = error;
      }
      catch (ex)
      {
      }
      return false;
    }
  }

  // 检查用户输入的积分
  if (document.getElementById("ECS_INTEGRAL"))
  {
    var integral = document.getElementById("ECS_INTEGRAL").value;
    var error    = Utils.trim(Ajax.call('flow.php?step=check_integral', 'integral=' + integral, null, 'GET', 'TEXT', false));

    if (error)
    {
      return false;
      try
      {
        document.getElementById("ECS_INTEGRAL_NOTICE").innerHTML = error;
      }
      catch (ex)
      {
      }
    }
  }

  if($('input[name="payment"]:checked').val() == 1 && !is_checked) {
     //这里密码验证
      $(".inpt_pasword").show();
        return false;
  } else {
    is_checked = false;
  }
  frm.action = frm.action + '?step=done';
  return true;
}

//余额支付  密码验证
$(function(){
    $('#check_pay_password').click(function(){
         var password = $('.inpt_pasword input[type="password"]').val();
         if(/^\s+$/g.test(password) || password == "") {
             alert('密码不能为空');
             return false;
         }
         Ajax.call('flow.php?step=checkPayPassword', 'password='+password, checkPayPasswordResponse, 'POST', 'JSON');
    });
});

//响应密码验证
function checkPayPasswordResponse(result) {
    if(result.status == 1) {
        is_checked = true;
        alert('验证成功');
        $('.inpt_pasword').hide();
    } else {
        alert(result.message);
    }
}
        </script>
        <div class="w fl_header clearfix">
            <a class="Left" href="/"><img class="fl_logo" src="images/blank.jpg"></a>
            <div class="Right fl_step fl_step_pre_checkout"></div>
        </div>
        <form action="flow.php" method="post" name="theForm" id="theForm" onSubmit="return checkOrderForm(this)">
            <script type="text/javascript">
        var flow_no_payment = "{$lang.flow_no_payment}";
        var flow_no_shipping = "{$lang.flow_no_shipping}";
            </script>
            <div class="flowBox">
                <h6>
                    <span>{$lang.goods_list}</span>
                    <!--{if $allow_edit_cart} -->
                    <a href="flow.php" class="f6">{$lang.modify}</a>
                    <!--{/if} -->
                </h6>
                <table width="100%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
                    <tr>
                        <th bgcolor="#ffffff">{$lang.goods_name}</th>
                        <th bgcolor="#ffffff">{$lang.goods_attr}</th>
                        <!-- {if $show_marketprice} -->
                        <th bgcolor="#ffffff">{$lang.market_prices}</th>
                        <!-- {/if} -->
                        <th bgcolor="#ffffff">{if $gb_deposit}{$lang.deposit}{else}{$lang.shop_prices}{/if}</th>
                        <th bgcolor="#ffffff">{$lang.number}</th>
                        <th bgcolor="#ffffff">{$lang.subtotal}</th>
                    </tr>
                    <!-- {foreach from=$goods_list item=goods} -->
                    <tr>
                        <td bgcolor="#ffffff">
                            <!-- {if $goods.goods_id gt 0 && $goods.extension_code eq 'package_buy'} -->
                            <a href="javascript:void(0)" onClick="setSuitShow({$goods.goods_id})" class="f6">{$goods.goods_name}<span style="color:#FF0000;">（{$lang.remark_package}）</span></a>
                            <div id="suit_{$goods.goods_id}" style="display:none">
                                <!-- {foreach from=$goods.package_goods_list item=package_goods_list} -->
                                <a href="goods.php?id={$package_goods_list.goods_id}" target="_blank" class="f6">{$package_goods_list.goods_name}</a><br />
                                <!-- {/foreach} -->
                            </div>
                            <!-- { else } -->
                            <a href="goods.php?id={$goods.goods_id}" target="_blank" class="f6">{$goods.goods_name}</a>
                            <!-- {if $goods.parent_id > 0} -->
                            <span style="color:#FF0000">（{$lang.accessories}）</span>
                            <!-- {elseif $goods.is_gift} -->
                            <span style="color:#FF0000">（{$lang.largess}）</span>
                            <!-- {/if} -->
                            <!-- {/if} -->
                            <!-- {if $goods.is_shipping} -->
                            (<span style="color:#FF0000">{$lang.free_goods}</span>)
                            <!-- {/if} -->
                        </td>
                        <td bgcolor="#ffffff">{$goods.goods_attr|nl2br}</td>
                        <!-- {if $show_marketprice} -->
                        <td align="center" bgcolor="#ffffff">{$goods.formated_market_price}</td>
                        <!-- {/if} -->
                        <td bgcolor="#ffffff" align="center">{$goods.formated_goods_price}</td>
                        <td bgcolor="#ffffff" align="center">{$goods.goods_number}</td>
                        <td bgcolor="#ffffff" align="center">{$goods.formated_subtotal}</td>
                    </tr>
                    <!-- {/foreach} -->
                    <!-- {if !$gb_deposit} 团购且有保证金时不显示 -->
                    <tr>
                        <td bgcolor="#ffffff" colspan="7" style="color:#A10101; font-size:14px; font-weight:bold">
                            <!-- {if $discount gt 0} -->
                            {$your_discount}<br />
                            <!-- {/if} -->
                            {$shopping_money}
                            <!-- {if $show_marketprice} -->
                            ，{$market_price_desc}
                            <!--{/if}-->
                        </td>
                    </tr>
                    <!-- {/if} -->
                </table>
            </div>
            <div class="blank"></div>
            <div class="flowBox">
                <h6><span>{$lang.consignee_info}</span></h6>
                <div style="border:1px solid #eee;margin-top:5px;">
                    <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#FFFFFF">
                        <tr>
                            <td width="10%" height="30" align=right style="padding-top:10px;">{$lang.consignee_name}：</td>
                            <td width="90%" height="30" style="padding-top:10px;">
                                <input type="text" name="consignee" value="{$consignee.consignee|escape}" size=15>
                                &nbsp;&nbsp;{if $smarty.session.user_id gt 0}{else}<b>【<a href="user.php?act=register"><font color=#ff3300>注册</font></a>会员可以累积折扣积分，会员点此<a href="user.php"><font color=#ff3300>登录</font></a>】</b>{/if}
                            </td>
                        </tr>
                        <tr>
                            <td align=right height="30">电话(手机)：</td>
                            <td height="30">
                                <input type="text" name="tel" value="{$consignee.tel}" size=15>
                                <font color=#ff3300>(必填) </font> 请填写有效联系电话或手机
                            </td>
                        </tr>
                        <tr>
                            <td height="30" align=right>配送区域：</td>
                            <td style="padding-left:7px">
                                <select name="country" id="selCountries_0" onchange="region.changed(this, 1, 'selProvinces_0')" style="border:1px solid #ccc;">
                                    <option value="0">请选择国家</option>
                                    <option value="1" selected>中国</option>
                                </select>
                                <select name="province" id="selProvinces_0" onchange="region.changed(this, 2, 'selCities_0')" onblur="shippingBox_change(document.forms['theForm'])" style="border:1px solid #ccc;">
                                    <option value="0">{$lang.please_select}{$name_of_region[1]}</option>
                                    <!-- {foreach from=$shop_province_list item=province} -->
                                    <option value="{$province.region_id}" {if $consignee.province eq $province.region_id}selected{/if}>{$province.region_name}</option>
                                    <!-- {/foreach} -->
                                </select>
                                <select name="city" id="selCities_0" onchange="region.changed(this, 3, 'selDistricts_0')" style="border:1px solid #ccc;">
                                    <option value="0">{$lang.please_select}{$name_of_region[2]}</option>
                                    <!-- {foreach from=$shop_city_list item=city} -->
                                    <option value="{$city.region_id}" {if $consignee.city eq $city.region_id}selected{/if}>{$city.region_name}</option>
                                    <!-- {/foreach} -->
                                </select>
                                <select name="district" id="selDistricts_0" {if !$shop_district_list}style="display:none" {/if} style="border:1px solid #ccc;">
                                <option value="0">{$lang.please_select}{$name_of_region[3]}</option>
                                <!-- {foreach from=$shop_district_list item=district} -->
                                <option value="{$district.region_id}" {if $consignee.district eq $district.region_id}selected{/if}>{$district.region_name}</option>
                                <!-- {/foreach} -->
                                </select><input type="hidden" name="consignee_post" value="1">
                                <input name="address_id" type="hidden" value="{$consignee.address_id}" />
                                <font color=#ff3300>(必填) </font>
                            </td>
                        </tr>
                        <!-- {if $total.real_goods_count gt 0} -->
                        <tr>
                            <td height="30" align=right>收货地址：</td>
                            <td height="30">
                                <input type="text" name="address" value="{$consignee.address|escape}" size=45>
                                <font color=#ff3300>(必填) </font> 请详细填写收货地址，便于及时、准确的收发货
                            </td>
                        </tr>
                        <!-- {/if} -->
                        <!-- {if $total.real_goods_count gt 0} -->
                        <tr>
                            <td align=right valign=top>订单附言：</td>
                            <td style="padding-left:7px">
                                <textarea name="postscript" rows=3 cols=70></textarea>
                            </td>
                        </tr>
                        <!-- {/if} -->
                    </table>
                </div>
            </div>
            <div class="blank"></div>
            <!--{if $total.real_goods_count neq 0}-->
            <div class="flowBox">
                <h6><span>{$lang.shipping_method}<font id="shippingBox_msg" style="font-weight:normal;color:#00c; margin-left:30px">注：请先选择配送区域（省市县），再选择配送方式</font></span></h6>
                <table width="100%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#fff" id="shippingTable" style="border:1px solid #eee;background-color:#FFFFFF">
                    <tr>
                        <td colspan="6" bgcolor="#ffffff" align="left" style="background-color:#FFFFFF">
                            <div id="shippingBox">
                                <table width="100%" cellpadding="0" cellspacing="0" style="border:1px solid #FFFFFF">
                                    <!-- {foreach from=$shipping_list name=shipping_list item=shipping} 循环配送方式 -->
                                    <tr>
                                        <td width="30%" height=25 valign=top>
                                            <input name="shipping" type="radio" value="{$shipping.shipping_id}" supportCod="{$shipping.support_cod}" insure="{$shipping.insure}" onclick="selectShipping(this)" />
                                            {$shipping.shipping_name}
                                            [{$shipping.format_shipping_fee}]
                                        </td>
                                        <td width="70%" valign=top> {$shipping.shipping_desc} </td>
                                    </tr>
                                    <!-- {/foreach} 循环配送方式 -->
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr style="display:none;">
                        <td colspan="6" bgcolor="#ffffff" align="right">
                            <label for="ECS_NEEDINSURE">
                                <input name="need_insure" id="ECS_NEEDINSURE" type="checkbox" onclick="selectInsure(this.checked)" value="1" {if $order.need_insure}checked="true" {/if} {if $insure_disabled}disabled="true"{/if}  />
                                {$lang.need_insure}
                            </label>
                        </td>
                    </tr>
                </table>
            </div>
            <div class="blank"></div>
            <!--{else}-->
            <input name="shipping" type="radio" value="-1" checked="checked" style="display:none" />
            <!--{/if}-->
            <!--{if $is_exchange_goods neq 1 || $total.real_goods_count neq 0}-->
            <div class="flowBox">
                <h6><span>{$lang.payment_method}</span></h6>
                <div style="border:1px solid #eee;margin-top:5px;">
                    <table width="100%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#fff" id="paymentTable" style="border:0px solid #eee;background-color:#FFFFFF">
                        <!-- {foreach from=$payment_list item=payment} -->
                        <!-- 循环支付方式 -->
                        <tr style="border-bottom:1px solid #CCCCCC">
                            <td valign="top" height=25 width="20%" bgcolor="#ffffff">
                                <input type="radio" name="payment" value="{$payment.pay_id}" isCod="{$payment.is_cod}" onclick="selectPayment(this)" {if $cod_disabled and $payment.is_cod eq "1" }disabled="true" {/if}/>
                                {$payment.pay_name}
                            </td>
                            <td valign="top" bgcolor="#ffffff">{$payment.pay_desc}</td>
                        </tr>
                        <!-- {/foreach} 循环支付方式 -->
                    </table>
                </div>
            </div>
            <!--{else}-->
            <input name="payment" type="radio" value="-1" checked="checked" style="display:none" />
            <!--{/if}-->
            <div class="blank"></div>
            <!-- {if $pack_list} 是否有包装 -->
            <div class="flowBox">
                <h6><span>{$lang.goods_package}</span></h6>
                <table width="100%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd" id="packTable">
                    <tr>
                        <th width="5%" scope="col" bgcolor="#ffffff">&nbsp;</th>
                        <th width="35%" scope="col" bgcolor="#ffffff">{$lang.name}</th>
                        <th width="22%" scope="col" bgcolor="#ffffff">{$lang.price}</th>
                        <th width="22%" scope="col" bgcolor="#ffffff">{$lang.free_money}</th>
                        <th scope="col" bgcolor="#ffffff">{$lang.img}</th>
                    </tr>
                    <tr>
                        <td valign="top" bgcolor="#ffffff"><input type="radio" name="pack" value="0" {if $order.pack_id eq 0}checked="true" {/if} onClick="selectPack(this)" /></td>
                        <td valign="top" bgcolor="#ffffff"><strong>{$lang.no_pack}</strong></td>
                        <td valign="top" bgcolor="#ffffff">&nbsp;</td>
                        <td valign="top" bgcolor="#ffffff">&nbsp;</td>
                        <td valign="top" bgcolor="#ffffff">&nbsp;</td>
                    </tr>
                    <!-- {foreach from=$pack_list item=pack} 循环包装 -->
                    <tr>
                        <td valign="top" bgcolor="#ffffff">
                            <input type="radio" name="pack" value="{$pack.pack_id}" {if $order.pack_id eq $pack.pack_id}checked="true" {/if} onClick="selectPack(this)" />
                        </td>
                        <td valign="top" bgcolor="#ffffff"><strong>{$pack.pack_name}</strong></td>
                        <td valign="top" bgcolor="#ffffff" align="right">{$pack.format_pack_fee}</td>
                        <td valign="top" bgcolor="#ffffff" align="right">{$pack.format_free_money}</td>
                        <td valign="top" bgcolor="#ffffff" align="center">
                            <!-- {if $pack.pack_img} 是否有图片 -->
                            <a href="data/packimages/img/{$pack.pack_img}" target="_blank" class="f6">{$lang.view}</a>
                            <!-- {else} -->
                            {$lang.no}
                            <!-- {/if} -->
                        </td>
                    </tr>
                    <!-- {/foreach} 循环包装 -->
                </table>
            </div>
            <div class="blank"></div>
            <!-- {/if} 是否使用包装 -->
            <!-- {if $card_list} 是否有贺卡 -->
            <div class="flowBox">
                <h6><span>{$lang.goods_card}</span></h6>
                <table width="100%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd" id="cardTable">
                    <tr>
                        <th bgcolor="#ffffff" width="5%" scope="col">&nbsp;</th>
                        <th bgcolor="#ffffff" width="35%" scope="col">{$lang.name}</th>
                        <th bgcolor="#ffffff" width="22%" scope="col">{$lang.price}</th>
                        <th bgcolor="#ffffff" width="22%" scope="col">{$lang.free_money}</th>
                        <th bgcolor="#ffffff" scope="col">{$lang.img}</th>
                    </tr>
                    <tr>
                        <td bgcolor="#ffffff" valign="top"><input type="radio" name="card" value="0" {if $order.card_id eq 0}checked="true" {/if} onClick="selectCard(this)" /></td>
                        <td bgcolor="#ffffff" valign="top"><strong>{$lang.no_card}</strong></td>
                        <td bgcolor="#ffffff" valign="top">&nbsp;</td>
                        <td bgcolor="#ffffff" valign="top">&nbsp;</td>
                        <td bgcolor="#ffffff" valign="top">&nbsp;</td>
                    </tr>
                    <!-- {foreach from=$card_list item=card} 循环贺卡 -->
                    <tr>
                        <td valign="top" bgcolor="#ffffff">
                            <input type="radio" name="card" value="{$card.card_id}" {if $order.card_id eq $card.card_id}checked="true" {/if} onClick="selectCard(this)"  />
                        </td>
                        <td valign="top" bgcolor="#ffffff"><strong>{$card.card_name}</strong></td>
                        <td valign="top" align="right" bgcolor="#ffffff">{$card.format_card_fee}</td>
                        <td valign="top" align="right" bgcolor="#ffffff">{$card.format_free_money}</td>
                        <td valign="top" align="center" bgcolor="#ffffff">
                            <!-- {if $card.card_img} 是否有图片 -->
                            <a href="data/cardimages/img/{$card.card_img}" target="_blank" class="f6">{$lang.view}</a>
                            <!-- {else} -->
                            {$lang.no}
                            <!-- {/if} -->
                        </td>
                    </tr>
                    <!-- {/foreach} 循环贺卡 -->
                    <tr>
                        <td bgcolor="#ffffff"></td>
                        <td bgcolor="#ffffff" valign="top"><strong>{$lang.bless_note}:</strong></td>
                        <td bgcolor="#ffffff" colspan="3"><textarea name="card_message" cols="60" rows="3" style="width:auto; border:1px solid #ccc;">{$order.card_message|escape}</textarea></td>
                    </tr>
                </table>
            </div>
            <div class="blank"></div>
            <!-- {/if} 是否使用贺卡 -->
            <div class="flowBox" style="display:none">
                <h6><span>{$lang.other_info}</span></h6>
                <table width="100%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
                    <!-- {if $allow_use_surplus} 是否使用余额 -->
                    <tr>
                        <td width="20%" bgcolor="#ffffff"><strong>{$lang.use_surplus}: </strong></td>
                        <td bgcolor="#ffffff">
                            <input name="surplus" type="text" class="inputBg" id="ECS_SURPLUS" size="10" value="{$order.surplus|default:0}" onBlur="changeSurplus(this.value)" {if $disable_surplus}disabled="disabled" {/if} />
                            {$lang.your_surplus}{$your_surplus|default:0} <span id="ECS_SURPLUS_NOTICE" class="notice"></span>
                        </td>
                    </tr>
                    <!-- {/if} 是否使用余额 -->
                    <!-- {if $allow_use_integral} 是否使用积分 -->
                    <tr>
                        <td bgcolor="#ffffff"><strong>{$lang.use_integral}</strong></td>
                        <td bgcolor="#ffffff">
                            <input name="integral" type="text" class="input" id="ECS_INTEGRAL" onBlur="changeIntegral(this.value)" value="{$order.integral|default:0}" size="10" />
                            {$lang.can_use_integral}:{$your_integral|default:0} {$points_name}，{$lang.noworder_can_integral}{$order_max_integral}  {$points_name}. <span id="ECS_INTEGRAL_NOTICE" class="notice"></span>
                        </td>
                    </tr>
                    <!-- {/if} 是否使用积分 -->
                    <!-- {if $allow_use_bonus} 是否使用红包 -->
                    <tr>
                        <td bgcolor="#ffffff"><strong>{$lang.use_bonus}:</strong></td>
                        <td bgcolor="#ffffff">
                            {$lang.select_bonus}
                            <select name="bonus" onChange="changeBonus(this.value)" id="ECS_BONUS" style="border:1px solid #ccc; height:22px">
                                <option value="0" {if $order.bonus_id eq 0}selected{/if}>{$lang.please_select}</option>
                                <!-- {foreach from=$bonus_list item=bonus} -->
                                <option value="{$bonus.bonus_id}" {if $order.bonus_id eq $bonus.bonus_id}selected{/if}>{$bonus.type_name}[{$bonus.bonus_money_formated}]</option>
                                <!-- {/foreach} -->
                            </select>
                            {$lang.input_bonus_no}
                            <input name="bonus_sn" type="text" class="inputBg" size="15" value="{$order.bonus_sn}" style="height:18px" />
                            <input name="validate_bonus" type="button" class="bnt_blue_1" value="{$lang.validate_bonus}" onClick="validateBonus(document.forms['theForm'].elements['bonus_sn'].value)" style="vertical-align:middle;" />
                        </td>
                    </tr>
                    <!-- {/if} 是否使用红包 -->
                    <!-- {if $inv_content_list} 能否开发票 -->
                    <tr>
                        <td bgcolor="#ffffff">
                            <strong>{$lang.invoice}:</strong>
                            <input name="need_inv" type="checkbox" class="input" id="ECS_NEEDINV" onClick="changeNeedInv()" value="1" {if $order.need_inv}checked="true" {/if} />
                        </td>
                        <td bgcolor="#ffffff">
                            <!-- {if $inv_type_list} -->
                            {$lang.invoice_type}
                            <select name="inv_type" id="ECS_INVTYPE" {if $order.need_inv neq 1}disabled="true" {/if} onChange="changeNeedInv()" style="border:1px solid #ccc;">

                            {html_options options=$inv_type_list selected=$order.inv_type}
                            </select>
                            <!-- {/if} -->
                            {$lang.invoice_title}
                            <input name="inv_payee" type="text" class="input" id="ECS_INVPAYEE" size="20" {if !$order.need_inv}disabled="true" {/if} value="{$order.inv_payee}" onBlur="changeNeedInv()" />
                            {$lang.invoice_content}
                            <select name="inv_content" id="ECS_INVCONTENT" {if $order.need_inv neq 1}disabled="true" {/if}  onchange="changeNeedInv()" style="border:1px solid #ccc;">


                            {html_options values=$inv_content_list output=$inv_content_list selected=$order.inv_content}


                            </select>
                        </td>
                    </tr>
                    <!-- {/if} -->
                    <tr>
                        <td valign="top" bgcolor="#ffffff"><strong>{$lang.order_postscript}:</strong></td>
                        <td bgcolor="#ffffff"><textarea name="postscript" cols="80" rows="3" id="postscript" style="border:1px solid #ccc;">{$order.postscript|escape}</textarea></td>
                    </tr>
                    <!-- {if $how_oos_list} 是否使用缺货处理 -->
                    <tr>
                        <td bgcolor="#ffffff"><strong>{$lang.booking_process}:</strong></td>
                        <td bgcolor="#ffffff">
                            <!-- {foreach from=$how_oos_list key=how_oos_id item=how_oos_name} -->
                            <label>
                                <input name="how_oos" type="radio" value="{$how_oos_id}" {if $order.how_oos eq $how_oos_id}checked{/if} onClick="changeOOS(this)" />
                                {$how_oos_name}
                            </label>
                            <!-- {/foreach} -->
                        </td>
                    </tr>
                    <!-- {/if} 缺货处理结束 -->
                </table>
            </div>
            <div class="blank"></div>
            <div class="flowBox">
                <h6><span>{$lang.fee_total}</span></h6>
                <!-- {if $allow_use_bonus} 是否使用红包 -->
                <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" bgcolor="#fffbe0" style="border:1px solid #d5d5d5;">
                    <tr>
                        <td align=left style="padding:10px 0 10px 20px">
                            {$lang.select_bonus}
                            <select name="bonus" onchange="changeBonus(this.value)" id="ECS_BONUS" style="border:1px solid #ccc;">
                                <option value="0" {if $order.bonus_id eq 0}selected{/if}>{$lang.please_select}</option>
                                <!-- {foreach from=$bonus_list item=bonus} -->
                                <option value="{$bonus.bonus_id}" {if $order.bonus_id eq $bonus.bonus_id}selected{/if}>{$bonus.type_name}[{$bonus.bonus_money_formated}]</option>
                                <!-- {/foreach} -->
                            </select>
                            {$lang.input_bonus_no}
                            <input name="bonus_sn" type="text" class="inputBg" size="15" value="{$order.bonus_sn}" />
                            <input name="validate_bonus" type="button" style="cursor:pointer;" value="使用红包" onclick="validateBonus(document.forms['theForm'].elements['bonus_sn'].value)" />
                        </td>
                    </tr>
                </table>
                <!-- {/if} 是否使用红包 -->
                <!-- #BeginLibraryItem "/Library/flow_order_total.lbi" --><!-- #EndLibraryItem -->
                <div align="center" style="margin:8px auto; text-align:center">

                    <input type="submit" name="submit" value="" class="pre_submit" style="cursor:pointer" />
                    <input type="hidden" name="step" value="done" />
                </div>
            </div>
        </form>

        <div name="输入密码" class="inpt_pasword">
            <div class="bottom000" onclick="$('.inpt_pasword').hide()"></div>
            <div class="pasword">
                <p>验证您的登录密码</p>
                <input type="password" placeholder="请输入密码" />
                <p><span id="check_pay_password">确定</span><span onclick="$('.inpt_pasword').hide()">取消</span></p>
            </div>
        </div>
        <!-- {/if} -->
        <!-- {if $step eq "done"} -->
        <script language="javascript">
function get_order_amount()
{
  Ajax.call('flow.php?step=get_order_amount', 'order_id=' + {$order.order_id}, orderAmountResponse, 'GET', 'JSON');
}

function orderAmountResponse(result)
{
	document.getElementById("sp_order_amount").innerHTML = result.formated_order_amount;
	document.getElementById("sp_pay_online").innerHTML = result.pay_online;
}
        </script>

        <div class="w fl_header clearfix">
            <a class="Left" href="/"><img class="fl_logo" src="images/blank.jpg" /></a>
            <div class="Right fl_step fl_step_done"></div>
        </div>
        <!-- 订单提交成功 -->
        <div class="flowBox">
            <h6 style="text-align:center; height:30px; line-height:30px;">{$lang.remember_order_number}: <font style="color:red">{$order.order_sn}</font></h6>
            <table width="100%" align="center" border="0" cellpadding="15" cellspacing="0" bgcolor="#fff" style="border:1px solid #ddd; margin:20px auto;">
                <tr>
                    <td align="center" bgcolor="#FFFFFF">
                        <table>
                            <!--{if $order.shipping_name}-->
                            <tr><td align="left"> {$lang.select_shipping}: <strong>{$order.shipping_name}</strong></td></tr>
                            <!--{/if}-->
                            <tr><td align="left">{$lang.select_payment}: <strong>{$order.pay_name}</strong></td></tr>
                            <tr>
                                <td align="left">
                                    {$lang.order_amount}: <strong style="color:#FF0000; font-size:18px" id="sp_order_amount">{$total.amount_formated}</strong>
                                    <!-- {if $pay_online} -->
                                    <input type="button" name="submit" value="更新订单总额" style="cursor:pointer; margin-left:15px" onClick="get_order_amount()" />
                                    <!-- {/if} -->
                                </td>
                            </tr>
                        </table>


                    </td>
                </tr>
                <tr>
                    <td align="center"><div style="height:1px; background-color:#CCCCCC; overflow:hidden; width:100%"></div></td>
                </tr>
                <tr>
                    <td align="center" bgcolor="#FFFFFF">{$order.pay_desc}</td>
                </tr>
                <!-- {if $pay_online} -->
                <!-- 如果是线上支付则显示支付按钮 -->
                <tr>
                    <td align="center" bgcolor="#FFFFFF" id="sp_pay_online">{$pay_online}</td>
                </tr>
                <!-- {/if} -->
            </table>
            <!--{if $virtual_card}-->
            <div style="text-align:center;overflow:hidden;border:1px solid #E2C822;background:#FFF9D7;margin:10px;padding:10px 50px 30px;">
                <!--{foreach from=$virtual_card item=vgoods}-->
                <h3 style="color:#2359B1; font-size:12px;">{$vgoods.goods_name}</h3>
                <!--{foreach from=$vgoods.info item=card}-->
                <ul style="list-style:none;padding:0;margin:0;clear:both">
                    <!--{if $card.card_sn}-->
                    <li style="margin-right:50px;float:left;"> <strong>{$lang.card_sn}:</strong><span style="color:red;">{$card.card_sn}</span> </li>
                    <!--{/if}-->
                    <!--{if $card.card_password}-->
                    <li style="margin-right:50px;float:left;"> <strong>{$lang.card_password}:</strong><span style="color:red;">{$card.card_password}</span> </li>
                    <!--{/if}-->
                    <!--{if $card.end_date}-->
                    <li style="float:left;"> <strong>{$lang.end_date}:</strong>{$card.end_date} </li>
                    <!--{/if}-->
                </ul>
                <!--{/foreach}-->
                <!--{/foreach}-->
            </div>
            <!--{/if}-->
            <p style="text-align:center; margin-bottom:20px;">{$order_submit_back}</p>
        </div>
        <!-- {/if} -->
        <!-- {if $step eq "login"} -->
        {insert_scripts files='utils.js,user.js'}
        <script type="text/javascript">
        {foreach from=$lang.flow_login_register item=item key=key}
          var {$key} = "{$item}";
        {/foreach}

        {literal}
        function checkLoginForm(frm) {
          if (Utils.isEmpty(frm.elements['username'].value)) {
            alert(username_not_null);
            return false;
          }

          if (Utils.isEmpty(frm.elements['password'].value)) {
            alert(password_not_null);
            return false;
          }

          return true;
        }

        function checkSignupForm(frm) {
          if (Utils.isEmpty(frm.elements['username'].value)) {
            alert(username_not_null);
            return false;
          }

          if (Utils.trim(frm.elements['username'].value).match(/^\s*$|^c:\\con\\con$|[%,\'\*\"\s\t\<\>\&\\]/))
          {
            alert(username_invalid);
            return false;
          }

          if (Utils.isEmpty(frm.elements['email'].value)) {
            alert(email_not_null);
            return false;
          }

          if (!Utils.isEmail(frm.elements['email'].value)) {
            alert(email_invalid);
            return false;
          }

          if (Utils.isEmpty(frm.elements['password'].value)) {
            alert(password_not_null);
            return false;
          }

          if (frm.elements['password'].value.length < 6) {
            alert(password_lt_six);
            return false;
          }

          if (frm.elements['password'].value != frm.elements['confirm_password'].value) {
            alert(password_not_same);
            return false;
          }
          return true;
        }
        {/literal}
        </script>
        <!-- 开始用户登录注册界面 -->
        <div class="w fl_header clearfix">
            <a class="Left" href="/"><img class="fl_logo" src="images/blank.jpg"></a>
            <div class="Right fl_step fl_step_pre_checkout"></div>
        </div>
        <div class="flowBox">
            <table width="100%" align="center" border="0" cellpadding="5" cellspacing="1" bgcolor="#dddddd">
                <tr>
                    <td width="50%" valign="top" bgcolor="#ffffff" style="padding-top:5px; vertical-align:text-top">
                        <h6 style="margin-top:0px; padding-top:0px; width:96%"><span>用户登录：</span></h6>
                        <form action="flow.php?step=login" method="post" name="loginForm" id="loginForm" onSubmit="return checkLoginForm(this)">
                            <table width="90%" border="0" cellpadding="8" cellspacing="1">
                                <tr style="height:50px">
                                    <td bgcolor="#ffffff"><div align="right"><strong>{$lang.username}</strong></div></td>
                                    <td bgcolor="#ffffff"><input name="username" type="text" class="inputBg" id="username" /></td>
                                </tr>
                                <tr>
                                    <td bgcolor="#ffffff"><div align="right"><strong>{$lang.password}</strong></div></td>
                                    <td bgcolor="#ffffff">
                                        <input name="password" class="inputBg" type="password" style="width:149px" />
                                        <a href="user.php?act=get_password" class="f6">忘记密码？</a>
                                    </td>
                                </tr>
                                <!-- 判断是否启用验证码{if $enabled_login_captcha} -->
                                <tr>
                                    <td bgcolor="#ffffff"><div align="right"><strong>{$lang.comment_captcha}:</strong></div></td>
                                    <td bgcolor="#ffffff" style="padding-left:0px">
                                        <table align="left">
                                            <tr>
                                                <td style="padding-left:0px"><input type="text" size="8" name="captcha" class="inputBg" style="width:45px; margin-left:0px" /></td>
                                                <td><img src="captcha.php?is_login=1&{$rand}" alt="captcha" style="vertical-align: middle;cursor: pointer;" onClick="this.src='captcha.php?is_login=1&'+Math.random()" /></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <!--{/if}-->
                                <tr>
                                    <td bgcolor="#ffffff"></td>
                                    <td bgcolor="#ffffff">
                                        <input type="checkbox" value="1" name="remember" id="remember" />
                                        <label for="remember">{$lang.remember}</label>
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#ffffff"></td>
                                    <td bgcolor="#ffffff">
                                        <input type="submit" class="bnt_blue_1" name="login" value=" {$lang.forthwith_login} " />
                                        <!-- {if $anonymous_buy eq 1} 是否允许未登录用户购物 -->
                                        <input type="button" class="bnt_blue_2" value="{$lang.direct_shopping}" onClick="location.href='flow.php?step=consignee&amp;direct_shopping=1'" />
                                        <!-- {/if} -->
                                        <input name="act" type="hidden" value="signin" />
                                    </td>
                                </tr>
                            </table>
                        </form>
                    </td>
                    <td valign="top" bgcolor="#ffffff">
                        <h6 style="margin-top:0px; padding-top:0px; width:96%"><span>用户注册：</span></h6>
                        <form action="flow.php?step=login" method="post" name="formUser" id="registerForm" onSubmit="return checkSignupForm(this)">
                            <table width="98%" border="0" cellpadding="8" cellspacing="1" class="table" style="margin-top:15px">
                                <tr>
                                    <td bgcolor="#ffffff" align="right" width="25%"><strong>{$lang.username}</strong></td>
                                    <td bgcolor="#ffffff">
                                        <input name="username" type="text" class="inputBg" id="username" onBlur="is_registered(this.value);" />
                                        <br />
                                        <div id="username_notice" style="color:#FF0000; padding-top:10px"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#ffffff" align="right"><strong>{$lang.email_address}</strong></td>
                                    <td bgcolor="#ffffff">
                                        <input name="email" type="text" class="inputBg" id="email" onBlur="checkEmail(this.value);" />
                                        <br />
                                        <div id="email_notice" style="color:#FF0000; padding-top:10px"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#ffffff" align="right"><strong>{$lang.password}</strong></td>
                                    <td bgcolor="#ffffff">
                                        <input name="password" class="inputBg" type="password" id="password1" onBlur="check_password(this.value);" onKeyUp="checkIntensity(this.value)" style="width:149px" />
                                        <br />
                                        <div style="color:#FF0000; padding-top:10px" id="password_notice"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td bgcolor="#ffffff" align="right"><strong>{$lang.confirm_password}</strong></td>
                                    <td bgcolor="#ffffff">
                                        <input name="confirm_password" class="inputBg" type="password" id="confirm_password" onBlur="check_conform_password(this.value);" style="width:149px" />
                                        <br />
                                        <div style="color:#FF0000; padding-top:10px" id="conform_password_notice"></div>
                                    </td>
                                </tr>
                                <!-- 判断是否启用验证码{if $enabled_register_captcha} -->
                                <tr>
                                    <td bgcolor="#ffffff" align="right"><strong>{$lang.comment_captcha}:</strong></td>
                                    <td bgcolor="#ffffff">
                                        <input type="text" size="8" name="captcha" class="inputBg" style="width:45px" />
                                        <img src="captcha.php?{$rand}" alt="captcha" style="vertical-align: middle;cursor: pointer;" onClick="this.src='captcha.php?'+Math.random()" />
                                    </td>
                                </tr>
                                <!--{/if}-->
                                <tr>
                                    <td bgcolor="#ffffff" align="right"></td>
                                    <td bgcolor="#ffffff">
                                        <input type="submit" name="Submit" class="bnt_blue_1" value="{$lang.forthwith_register}" />
                                        <input name="act" type="hidden" value="signup" />
                                    </td>
                                </tr>
                            </table>
                        </form>
                    </td>
                </tr>
                {if $need_rechoose_gift}
                <tr>
                    <td colspan="2" align="center" style="border-top:1px #ccc solid; padding:5px; color:red;">{$lang.gift_remainder}</td>
                </tr>
                {/if}
            </table>
        </div>
        <!-- 结束用户登录注册界面 -->
        <!-- {/if} -->
    </div>
    <div class="blank5"></div>
    <!-- #BeginLibraryItem "/library/page_footer.lbi" --><!-- #EndLibraryItem -->
</body>
<script type="text/javascript">
var process_request = "{$lang.process_request}";
{foreach from=$lang.passport_js item=item key=key}
var {$key} = "{$item}";
{/foreach}
var username_exist = "{$lang.username_exist}";
var compare_no_goods = "{$lang.compare_no_goods}";
var btn_buy = "{$lang.btn_buy}";
var is_cancel = "{$lang.is_cancel}";
var select_spe = "{$lang.select_spe}";
</script>
</html>
